package keypairs

import (
	"gitee.com/djaf/my-certs/app/data/dxo"
	"gitee.com/djaf/my-certs/app/data/entity"
	"gorm.io/gorm"
)

// DAO ...
type DAO interface {
	Insert(db *gorm.DB, item *entity.KeyPair) (*entity.KeyPair, error)

	Update(db *gorm.DB, id dxo.KeyPairID, fn func(item *entity.KeyPair)) (*entity.KeyPair, error)

	Remove(db *gorm.DB, id dxo.KeyPairID) error

	Find(db *gorm.DB, id dxo.KeyPairID) (*entity.KeyPair, error)

	List(db *gorm.DB) ([]*entity.KeyPair, error)
}
